package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ActivityEnrollmentMapper;
import com.ruoyi.system.domain.ActivityEnrollment;
import com.ruoyi.system.service.IActivityEnrollmentService;

/**
 * 活动报名Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-26
 */
@Service
public class ActivityEnrollmentServiceImpl implements IActivityEnrollmentService 
{
    @Autowired
    private ActivityEnrollmentMapper activityEnrollmentMapper;

    /**
     * 查询活动报名
     * 
     * @param enrollmentId 活动报名主键
     * @return 活动报名
     */
    @Override
    public ActivityEnrollment selectActivityEnrollmentByEnrollmentId(Long enrollmentId)
    {
        return activityEnrollmentMapper.selectActivityEnrollmentByEnrollmentId(enrollmentId);
    }

    /**
     * 查询活动报名列表
     * 
     * @param activityEnrollment 活动报名
     * @return 活动报名
     */
    @Override
    public List<ActivityEnrollment> selectActivityEnrollmentList(ActivityEnrollment activityEnrollment)
    {
        return activityEnrollmentMapper.selectActivityEnrollmentList(activityEnrollment);
    }

    /**
     * 新增活动报名
     * 
     * @param activityEnrollment 活动报名
     * @return 结果
     */
    @Override
    public int insertActivityEnrollment(ActivityEnrollment activityEnrollment)
    {
        activityEnrollment.setCreateTime(DateUtils.getNowDate());
        return activityEnrollmentMapper.insertActivityEnrollment(activityEnrollment);
    }

    /**
     * 修改活动报名
     * 
     * @param activityEnrollment 活动报名
     * @return 结果
     */
    @Override
    public int updateActivityEnrollment(ActivityEnrollment activityEnrollment)
    {
        activityEnrollment.setUpdateTime(DateUtils.getNowDate());
        return activityEnrollmentMapper.updateActivityEnrollment(activityEnrollment);
    }

    /**
     * 批量删除活动报名
     * 
     * @param enrollmentIds 需要删除的活动报名主键
     * @return 结果
     */
    @Override
    public int deleteActivityEnrollmentByEnrollmentIds(Long[] enrollmentIds)
    {
        return activityEnrollmentMapper.deleteActivityEnrollmentByEnrollmentIds(enrollmentIds);
    }

    /**
     * 删除活动报名信息
     * 
     * @param enrollmentId 活动报名主键
     * @return 结果
     */
    @Override
    public int deleteActivityEnrollmentByEnrollmentId(Long enrollmentId)
    {
        return activityEnrollmentMapper.deleteActivityEnrollmentByEnrollmentId(enrollmentId);
    }
}
